#include <chain-of-responsibility_pattern.h>
#include <iostream>

void AbstractLogger::setNextLogger(AbstractLogger *nextLogger)
{
    this->nextLogger = nextLogger;
}

void AbstractLogger::logMessage(int level, string message)
{
    if(this->level == level)
    {
        write(message);
    } else {
        this->nextLogger->logMessage(level, message);
    }
}

ConsoleLogger::ConsoleLogger(int level)
{
    this->level = level;
}

void ConsoleLogger::write(string message)
{
    cout << "Standard Console::Logger: " << message << endl;
}

ErrorLogger::ErrorLogger(int level)
{
    this->level = level;
}

void ErrorLogger::write(string message)
{
    cout << "Error Console::Logger: " << message << endl;
}

FileLogger::FileLogger(int level)
{
    this->level = level;
}

void FileLogger::write(string message)
{
    cout << "File Console::Logger: " << message << endl;
}
